package com.gnerv.sylvanas.framework.core.autoconfigure;

import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.ComponentScan;

import java.util.Set;

/**
 * @author Gnerv LiGen
 */
@Slf4j
@Data
@ComponentScan(value = "com.gnerv.sylvanas.framework.core")
@ConfigurationProperties(prefix = "sylvanas.core")
public class FrameworkCoreConfigProperties {

    private String name;
    private ThreadPool threadPool = new ThreadPool();

    @Data
    public static class ThreadPool {
        private int corePoolSize = 10;
        private int maxPoolSize = 20;
        private int queueCapacity = 200;
        private int keepAliveSeconds = 60;
        private String threadNamePrefix = "sylvanas-executor-";
        private boolean allowCoreThreadTimeOut = true;
        private boolean waitForTasksToCompleteOnShutdown = true;
        private int awaitTerminationSeconds = 60;
    }

}
